#ifndef JOY_DAO_H
#define JOY_DAO_H

#include "global.h"
#include "SQL.h"
#include "Db.h"

#define Record map<int,string>
#define RecordSet vector< Record >

namespace ZY {

    class Dao : public Db
    {
        public:
            Dao();
            virtual ~Dao();

            RecordSet & FetchAll( SQL & where );
            Record Fetch( SQL & where );
            RecordSet & FetchAll( string sql );
            Record Fetch( string sql );
            int Insert( map<string,string> data );
            int ReplaceInto( map<string,string> data );

        protected:
        private:

    };

}
#endif // JOY_DAO_H
